import request from '@/utils/request'

// 获取员工列表
export const getEmployeeList = params => request.get('/sys/user', {
  params
})

// 导出员工
export const exportEmployee = () => request.get('/sys/user/export', {
  responseType: 'blob'
})

// 导出员工模板
export const getExportTemplate = () => request.get('/sys/user/import/template', {
  responseType: 'blob'
})

// 导入员工表格
export const uploadExcel = (data) => request.post('/sys/user/import', data)

// 删除员工
export const delEmployee = (id) => request.delete(`/sys/user/${id}`)

// 新增员工
export const addEmployee = (data) => request.post('/sys/user', data)

// 获取员工详情
export const getEmployeeDetail = id => request.get(`/sys/user/${id}`)

// 编辑员工
export const editEmployee = data => request.put(`/sys/user/${data.id}`, data)
